package com.example.leetcode.array;

class Solution2455 {
    public int averageValue(int[] nums) {
        int count = 0;
        int sum = 0;
        for (int num : nums) {
            if (num % 6 == 0) {
                count++;
                sum += num;
            }
        }
        return count == 0 ? 0 : sum / count;
    }
}

public class leetcode2455 {
    public static void main(String[] args) {
        Solution2455 solution2455 = new Solution2455();
        int[] nums = {1, 3, 6, 10, 12, 15};
        System.out.println(solution2455.averageValue(nums));
    }
}
